<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

class m_kritik_saran_model extends arfaModel
{
    function __construct() {
        parent::__construct();
		$this->table_name	= "kuesioner_kritik_saran";
		$this->primary_key	= "kd_kuesioner_kritik_saran";
		$this->order_by		= "kd_kuesioner_kritik_saran ASC";
    }

    public function get_jumlah($tgl_awal,$tgl_akhir) {
        $this->db->select("*");
        $this->db->from($this->table_name);
        $this->db->join("kuesioner", "kuesioner_kritik_saran.kd_kuesioner = kuesioner.kd_kuesioner");
        $this->db->where("kuesioner.TGL_KUESIONER >=", $tgl_awal);
        $this->db->where("kuesioner.TGL_KUESIONER <=", $tgl_akhir);
        $this->db->group_by("kuesioner.TGL_KUESIONER");
        $query = $this->db->get();

        return $query->result_array();
    }

    public function get_data_kritik_saran($tanggal) {
    	$this->db->select("*");
    	$this->db->from($this->table_name);
    	$this->db->join("kuesioner", "kuesioner_kritik_saran.kd_kuesioner = kuesioner.kd_kuesioner");
    	$this->db->like("kuesioner.TGL_KUESIONER", $tanggal);
    	$query = $this->db->get();

    	return $query->result_array();
    }
}